/**********************************************************************
 *
 * $RCSfile: OrdinaryEventType.java,v $  $Revision: 1.2 $  $Date: 2009/09/07 02:24:00 $
 *
 * $Log: OrdinaryEventType.java,v $
 * Revision 1.2  2009/09/07 02:24:00  @author simplefan
 * *** empty log message ***
 *
 * Revision 1.1  2009/08/09 07:59:09  @author simplefan
 * *** empty log message ***
 *
 *
 *
 *********************************************************************/
/*
 * Copyright 2008 gxlu, Inc. All rights reserved.
 * File name : OrdinaryEventType.java
 * Created on : Jul 30, 2009 12:40:00 PM
 * Creator : lethe
 */
package com.simplefan.meta.eda;

/**
 * <pre>
 * Description : TODO
 * @author simplefan
 * </pre>
 */
public class OrdinaryEventType extends AbstractEventType implements EventType {

  private static final String USER_LOGIN_EVENT_TYPE = "USER_LOGIN_EVENT_TYPE";

  private static final String METAPLATFORM_STARTSUCCESSFUL_EVENT_TYPE = "METAPLATFORM_STARTSUCCESSFUL_EVENT_TYPE";

  private static final OrdinaryEventType userLoginEventType = new OrdinaryEventType(USER_LOGIN_EVENT_TYPE);

  private static final OrdinaryEventType metaStartSuccessful = new OrdinaryEventType(METAPLATFORM_STARTSUCCESSFUL_EVENT_TYPE);

  public static OrdinaryEventType getUserLoginEventType() {
    return userLoginEventType;
  }

  public static OrdinaryEventType getMetaStartSuccessfulEventType() {
    return metaStartSuccessful;
  }

  private String eventTypeKey;

  private OrdinaryEventType(String eventTypeKey){
    this.eventTypeKey = eventTypeKey;
  }

  @Override
  public int hashCode() {
    return eventTypeKey.hashCode();
  }

  @Override
  public boolean equals(Object obj) {
    if(obj != null && obj instanceof OrdinaryEventType) {
      return (((OrdinaryEventType)obj).eventTypeKey).equals(this.eventTypeKey);
    }
    else {
      return false;
    }
  }

  @Override
  public String toString() {
    return eventTypeKey;
  }
}
